<template>
  <div class="dialog">
    <!-- 弹框 -->
    <!-- :title="textMap"弹框 -->
    <el-dialog
      v-el-drag-dialog
      :visible.sync="dialogFormVisible"
      :before-close="handleCloseBindWarnStandard"
    >
      <slot name="title"></slot>
      <!-- <el-dialog title="textMap" :visible.sync="dialogFormVisible"> -->
      <!-- <h2 slot="title">添加订单</h2> -->
      <slot></slot>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleCancel">Cancel</el-button>
        <el-button type="primary" @click="handleConfirm">Confirm</el-button>
      </div>
    </el-dialog>
    <!-- 提示语 -->



    <dia-log
      :dialogFormVisible.sync="dialogFormVisible"
      @getCancel="handleCancel"
      @getConfirm="handleConfirm==='update'?createData():updateData()"
      @closeBindWarnStandard="handleCloseBindWarnStandard"
    >
  </div>
</template>
<script>
  import elDragDialog from "@/directive/el-drag-dialog";
  export default {
    directives: { elDragDialog },
    props: {
      dialogFormVisible: {
        type: Boolean,
        default: false
      }
      // textMap: {
      //   type: Object,
      //   default: () => {}
      // }
    },
    data() {
      return {
        // dialogStatus: ""
      };
    },
    watch: {},
    methods: {
      // 点击弹框下的取消
      handleCancel() {
        this.$emit("getCancel");
      },
      // 点击弹框下的确定
      handleConfirm() {
        this.$emit("getConfirm");
      },
      //关闭弹窗，不可以删这个方法。不用这个方法点击遮罩层关闭会报错
      handleCloseBindWarnStandard() {
        this.$emit("closeBindWarnStandard");
      }
    }
  };
</script>